package com.db.jvlife.core.definitions;

import java.util.ArrayList;

import com.db.jvlife.exceptions.InvalidChainRingException;

public class DNAChain {
	private ArrayList<String> chain = new ArrayList<String>();

	public DNAChain(ArrayList<String> chain) {
		super();
		this.chain = chain;
	}
	
	public DNAChain() {
		super();
	}

	public ArrayList<String> getChain() {
		return chain;
	}

	public void setChain(ArrayList<String> chain) {
		this.chain = chain;
	}

	/**
	 * 
	 * @param value Must be one of the following: "T", "C", "G", "A" case insensitive
	 * @throws InvalidChainRingException 
	 * 
	 * 
	 */
	public void addRing(String value) throws InvalidChainRingException{
		if(value.compareToIgnoreCase("A") != 0 || value.compareToIgnoreCase("G") != 0 || value.compareToIgnoreCase("C") != 0 || value.compareToIgnoreCase("T") != 0) throw new InvalidChainRingException("The value must be one of the following: \"T\", \"C\", \"G\", \"A\" case insensitive "); 
		chain.add(value);
	}
	
}
